package com.tct.worktimeboard.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Huhailong
 * @Description
 * @Date 2021/2/23.
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("group_type")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class GroupType extends PageObject implements Serializable {
    @TableId(type = IdType.AUTO)
    private Long id;
    @Excel(name="部门类型",orderNum = "1",needMerge = true)
    private String kindCode;    //dept(部门) or bu
    @Excel(name="部门名称",orderNum = "2",needMerge = true)
    private String kindName;
    private Long parentId;
    private String createTime;

    @TableField(exist = false)
    @ExcelCollection(name = "分组",orderNum = "3")
    private List<WorkGroup> workGroupList;

    @TableField(exist = false)
    private List<GroupType> children = new ArrayList<>();
}
